package main.chapter3;/**
 * @Author xy
 * @Date 2020/6/5 4:13
 * @Description
 */

import javafx.scene.transform.Scale;

import java.math.BigDecimal;
import java.util.Scanner;

/**
 * 文件名称： main.chapter3.LotteryOdds.java</br>
 * 初始作者： xy</br>
 * 创建日期： 2020/6/5 4:13</br>
 * 功能说明： TODO <br/>
 * =================================================<br/>
 * 修改记录：<br/>
 * 修改作者        日期       修改内容<br/>
 * ================================================<br/>
 * Copyright (c) 2020-2021 .All rights reserved.<br/>
 */
public class LotteryOdds {
    public static void main(String[] args) {
        Scanner in  = new Scanner(System.in);
        System.out.println("How many numbers do you need to draw?");
        int k = in.nextInt();

        System.out.println("what the highest number you can draw?");
        int n =  in.nextInt();

        int lotteryOdds = 1;
        for (int i = 1; i <= k; i++) {
            lotteryOdds = lotteryOdds * (n-i+1)/i;
        }
        System.out.println("Your odds are 1 in "+ lotteryOdds + ". Good luck");

        System.out.println(BigDecimal.valueOf(100L,2));
    }
}
